package com.itgaoshu.hospitalproject.mapper;

import com.itgaoshu.hospitalproject.bean.CCashier;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface xmjfMapper {

    //查询用户所有的项目
    @Select("select * from cashier where reportId=#{reid} and state=1 and mstate=0 ORDER BY cashier DESC")
    List<CCashier> selxiang(Integer perid);
    //查询该用户有没有收费项目
    @Select("select sum(repicetotal) from  cashier where  reportId=#{perid} and state =1 and mstate=0")
    Integer selshoux(Integer perid);
    //项目收费修改项目的收费状态
    @Update("UPDATE cashier SET mstate = 1 WHERE reportId=#{perid} and mstate = 0")
    Integer updxiang(Integer perid);
    //项目检查页面查询用户所有要检查的项目
    @Select("select  * from  cashier where reportId=#{perid} and state=1 and ostate=1 and mstate=1 ORDER BY cashier DESC")
    List<CCashier> selcha(Integer perid);
    //添加项目的检查结果
    @Update("UPDATE cashier SET jie = #{jie} WHERE reportId=#{reportId} and cashier = #{cashier}")
    Integer addjie(CCashier cCashier);
}
